package com.bigShen.mybatis.spring;

import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;

/**
 * @author : lei.shen
 * @date : 2018/12/20
 */
public class MybatisSpringMain {

    public static void main(String[] args) {

        SqlSessionTemplate sqlSessionTemplate = null;
        SqlSessionDaoSupport sqlSessionDaoSupport = null;
        SqlSession sqlSession = null;
    }

    private void openSimpleTransaction(DataSourceTransactionManager txManager) throws Exception {

        //DefaultTransactionDefinition def = new DefaultTransactionDefinition();
        //def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
        //
        //TransactionStatus status = txManager.getTransaction(def);
        //try {
        //    userMapper.insertUser(user);
        //}
        //catch (Exception ex) {
        //    txManager.rollback(status);
        //    throw ex;
        //}
        //txManager.commit(status);

    }

}
